home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / com_and3.zip / OUTDIR.CMD < prev    next >
OS/2 REXX Batch file  |  1989-10-09  |  2KB  |  57 lines

  1. ; ----- INDIR: Load the dialing directory from an ASCII file
  2. ; ----------------------------------------------------------------
  3. ;    Note: This script writes to the filele DIALING.TXT.  The file
  4. ;    is given AN ASCII file format.    Records have the structure:
  5. ;
  6. ;  Col: 0          38            57              61
  7. ;    +-----+-/ /-+-----+-----+-/ /-+-----+-----+-/ /-+-----+-//
  8. ;    !  Entry name      !  Phone number   ! Speed          !
  9. ;    +-----+-/ /-+-----+-----+-/ /-+-----+-----+-/ /-+-----+-//
  10. ;         !           !             +--------- 4 chars
  11. ;         !           +--------------------------- 14 chars
  12. ;         +--------------------------------------------- 24 chars
  13. ;
  14. ;  Col:       61    62      63    64    65    66      67    68    69    70
  15. ;          +-----+-----+-----+-----+-----+-----+-----+-----+-----+-//
  16. ;          !     !  P  !    !  D  !     !  S  !    !  E  !     !
  17. ;          +-----+-----+-----+-----+-----+-----+-----+-----+-----+-//
  18. ;               !       !           !       +--- Echo Y/N
  19. ;               !       !           +--------------- Stop 1/2
  20. ;               !       +--------------------------- Data 7/8
  21. ;               +--------------------------------------- Parity E/N/O
  22. ;
  23. ;  Col:       70        78
  24. ;          +-----+-/ /-+-----+
  25. ;          ! Script file    !
  26. ;          +-----+-/ /-+-----+
  27. ;               +--------------------------------------- 8 chars
  28. ;
  29. ; ----------------------------------------------------------------
  30. ;
  31. ;    Open the output file, purgins if it exists
  32. ;
  33.     FOPENO "DIALING.TXT" TEXT
  34.     LEGEND "OutDir: Dialing directory output"
  35. ;
  36. ;    Write 100 lines of output
  37. ;
  38.     FOR N0 = 1,100
  39.         DIRECTO S0 N0    ; Entry name
  40.         IF NOT STRCMP S0(0:5) "......" ; Skip empty entries
  41.            LEGEND "OutDir: Entry # "*N0*" output"
  42.            DNUMBER S1 N0    ; Entry number
  43.            DPARMS  S2 N0    ; Entry parameters
  44.            DSCRIPT S3 N0    ; Script name when used
  45.            UPPER S3     ; Make upper case
  46.            S0(38:79) = S1    ; Put 'em together
  47.            S0(57:79) = S2
  48.            S0(70:79) = S3
  49.            WRITE S0 79    ; Write to disc
  50.            WRITE "!" 1
  51.            ENDIF
  52.         ENDFOR
  53. ;
  54. ;    And close the output file
  55. ;
  56.     FCLOSEO
  57.